#ifndef CLASSES_H
#define CLASSES_H

class Bullet;
class Skill;
class Minion;
class Map;
class Engine;

enum SkillFlags
{
  SKILL_NONE      = 0x0,
  TARGET_LOCATION = 0x1,
  TARGET_FRIEND   = 0x2,
  TARGET_ENEMY    = 0x4,
  TARGET_TOWER    = 0x8,
  TARGET_MINI     = 0x10,
  PASSIVE         = 0x20
};

enum BulletFlags
{
    BULLET_NONE  = 0x0,
    IGNORE_ARMOR = 0x1,
    GUIDED       = 0x2 // if set, bullet will change trajectory as the target moves, but will lose target, if it disappears (teleports away or becomes invisible)
};

enum MinionFlags
{
    MINION_NONE   = 0x0,
    AREA_SHOOT    = 0x1, // shoot damages all in range
    TURN_AND_MOVE = 0x2, // can turn and move at the same time
    INVISIBLE     = 0x4,
    IS_MINI       = 0x8, // minion is a miniminion (disappears when killed, doesn't provide exp boost)
    IS_TOWER      = 0x10, // minion is an unmovable tower
    IS_BASE       = 0x20, // minion is an unmovable base - its destruction means losing the game
    IS_FOLLOWING  = 0x40, // minion is current following its target (DestinationX,Y will be updated)
    NO_COLLISION  = 0x80,
    IS_WRECK      = 0x100, // minion was destroyed and is an unmovable wreckage (after a few seconds it becomes movable ghost)
    IS_RESPAWNING = 0x200 // minion is respawning (growing)
};

inline bool equal(double a, double b, double precision)
{
    double c = a - b;
    return (c < precision) && (c > -precision);
}

inline void normalize(double &parameter, double min, double max)
{
    while(parameter < min) parameter += max-min;
    while(parameter >= max) parameter -= max-min;
}

#endif // CLASSES_H
